package stringjob;

public class Matches {
    public static void main(String[] args) {
        String email = "wangkj@atedu.cn";
        String regex = "[a-zA-Z0-9_]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)";
        boolean math = email.matches(regex);
        if (math) {
            System.out.println("正确的邮箱格式");
        } else {
            System.out.println("错误的邮箱格式");
        }


        String a = "jndasuh@das213.com";
        String r = "[a-zA-Z0-9_]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)";
        boolean m = a.matches(r);
        if (m) {
            System.out.println("正确");
        }else {
            System.out.println("错误");
        }

        String b="dasd18@das54.cn";
        String o="[a-zA-Z0-9_]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)";
        boolean i=b.matches(o);
        if(i){
            System.out.println("正确");
        }else{
            System.out.println("错误");
        }
    }
}
